package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;

public class ServerConsoleGUI extends JFrame{

	private JPanel contentPane;
	JTextArea ConsoleWrite;
	ConsoleGUI Console;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ServerConsoleGUI frame = new ServerConsoleGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public ServerConsoleGUI() {
		setResizable(false);
		setAlwaysOnTop(true);
		BuildGUI();
		this.setVisible(true);
	}
	
	public void BuildGUI(){
		setTitle("Server Console");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setForeground(Color.WHITE);
		contentPane.setBackground(Color.BLACK);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		Console = new ConsoleGUI();
		this.add(Console);
		/*
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		scrollPane.setBounds(0, 0, 444, 272);
		contentPane.add(scrollPane);
		
		ConsoleWrite = new JTextArea();
		ConsoleWrite.setEditable(false);
		ConsoleWrite.setLineWrap(true);
		ConsoleWrite.setForeground(Color.GREEN);
		ConsoleWrite.setBackground(Color.BLACK);
		scrollPane.setViewportView(ConsoleWrite);
		*/
	}
	
	public void setMessageToScreen(String msessage){
		Console.setMessageToScreen(msessage);
	}
	
}
